package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:对二叉树进行主要的复习
 * User: 石方旭
 * Date: 2022-06-24
 * Time: 6:27
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        //System.out.println(binaryTree.size(root));
        //System.out.println(binaryTree.getLeafNodeCount(root));
        //System.out.println(binaryTree.getKLevelNodeCount(root,4));
        //System.out.println(binaryTree.getHeight(root));
        //BinaryTree.TreeNode cur = binaryTree.find(root, 5);
        //System.out.println(cur.val);
        //binaryTree.levelOrder(root);
        System.out.println(binaryTree.isCompleteTree(root));
    }

    public static void main1(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
    }

}
